import React, { PureComponent } from 'react'

// 高级组件 对组件进行额外操作
function enhancedUserInfo (OriginComponent) {
  class NewComponent extends PureComponent {
    constructor(props) {
      super(props)
      this.state = {
        name: 'coderwhy',
        level: 99
      }
    }
    render () {
      return <OriginComponent {...this.props} {...this.state} />
    }

  }
  return NewComponent;
}
export default enhancedUserInfo